home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 179
/
179.d81
/
green flash
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
7KB
|
240 lines
5 poke55,.:poke56,56:clr
10 dv=peek(186):ifdv<8thendv=8
15 poke53280,0:poke53281,0:print"[147]"
16 poke53371,0
25 poke53272,31
30 ad=49152
35 sysad:sysad+12
40 bx$="[159][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180]
42 [153]"loadopen(NULL)andandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandand(NULL)":[158]ad[170]9,15
44 [153]bx$"";[163]38)bx$
45 lc[178]0
46 [153]"open(NULL)andandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandnot"
49 [153]"":[153][163]1)"print (NULL)left$val chr$(NULL)valval(NULL) asc(NULL)atn(NULL)left$ lenatn(NULL)len(NULL)(NULL)atn(NULL)(NULL)(NULL)! "
50 [143] the green flash
55 :
60 [153][163]2)"contleft$eight of (NULL)bserver sysft ";:l9%[178]8:[141]1040:h[178]q9
65 [153][163]2)"cont(NULL)enith dist. (NULL)cculting edge sys((NULL)) ";:l9%[178]3:[141]1040:z0[178]q9
70 [153][163]2)"contatnerosol valxtinction sys(haziness) ";:l9%[178]4:[141]1040:kd[178]q9
75 [153][163]2)"cont(NULL)ccult sys(peek)contottom or sys((NULL))contop of (NULL)un: ":[151]198,.
80 [161]a$:[139]a$[179][177]"t"[175]a$[179][177]"b"[167]80
82 [139]a$[178]"t"[167]tb[178][171]1:[158]ad[170]9,16:[137]85
84 tb[178]1:[158]ad[170]9,16
85 [153]:[141]830
90 ds[178]1:[143] sun's dist in a.u.
95 rs[178]1:[143] sun's radius in solar radii
100 ts[178]5700:[143] readun's temp kelvin
105 d[178]0:[143] sun's declination in degrees
110 mp[178]1:[143] planet's mass in earth masses
115 pe[178]1:[143] planet's rotation period in days
120 r0[178]1:[143] planet's radius in earth radii
125 [153][163]2)"cont(NULL)our (NULL)atitude: ";:l9%[178]6:[141]1040:l[178]q9
130 p[178]1:[143] sea-level pressure bars
135 [153][163]2)"contlenurrent (NULL)emperature sys(asc(NULL)): ";:l9%[178]3:[141]1040:ct[178]q9
137 t0[178]ct[171]32[172]5[173]9
140 oz[178]3:[143] ozone layer thickness (mm at stp)
142 [153]:[153][163]5)"right$s (NULL)his lenorrect? open(NULL)/(NULL)":[151]198,.
143 [161]a$:[139]a$[179][177]"y"[175]a$[179][177]"n"[167]143
144 [139]a$[178]"n"[167]42
145 hs[178]12:[143] ozone ht. (miles above sea level)
148 [153]"load":[153][163]3)"lenatn(NULL)len(NULL)(NULL)atn(NULL)right$(NULL)chr$... (NULL)ne (NULL)oment!":[158]ad[170]9,17
150 aa[178][171]1.3:[143] aerosol exponent (unitless)
155 ah[178]1:[143] aerosol scale height (miles)
160 pp(1)[178]78:[143] nitrogen % by volume
165 pp(2)[178]22:[143] oxygen percent
170 pp(3)[178]0:[143] carbon dioxide
175 pp(4)[178]0:[143] hydrogen
180 pp(5)[178]0:[143] helium
185 pp(6)[178]0:[143] methane
190 pp(7)[178]0:[143] ammonia
195 pp(8)[178]0:[143] argon
200 :
205 [143] convert input data to cgs units
210 ds[178]ds[172]1.496e[170]13:rs[178]rs[172]6.96e[170]10
215 r0[178]r0[172]6.378e[170]8:h[178]h[172]30.48
220 hs[178]hs[172]1.609e[170]5:ah[178]ah[172]1.609e[170]5
225 d[178]d[172]pi[173]180:l[178]l[172]pi[173]180:z0[178]z0[172]pi[173]180
230 mp[178]mp[172]5.976e[170]27
235 pe[178]pe[172]24[172]3600
240 t0[178]t0[170]273.1
245 [158]ad[170]9,17
250 [143] calcuate average molecular weight
255 mw[178]0
260 [129]ig[178]1[164]8:mw[178]mw[170]mx(ig)[172]pp(ig)[172].01:[130]ig
265 :
270 [143] calcuate atmospheric parameters
275 g[178]6.67e[171]8[172]mp[172](r0[174][171]2)
280 s[178]8.31e[170]7[172]t0[173](g[172]mw)
285 la[178][171].4[172]t0[173]s
290 :
295 [143] choose a color
300 [129]ic[178]1[164]11
305 w[178](ic[172]500[170]2500)[172]1e[171]8
310 [143] calcuate index of refraction
315 n0[178]0
320 [129]ig[178]1[164]8
325 ns[178](a(ig)[172].00001)[172](1[170](b(ig)[172]1e[171]11)[173](w[174]2))
330 n0[178]n0[170]ns[172]pp(ig)[172].01[172]p[172]273.1[173]t0
335 [130]ig
340 n[178]1[170]n0[172][189]([171]h[173]s)
345 n0[178]n0[170]1
350 :
355 [143] cal refraction & air mass for each color
360 [141]795
365 [139]rf[177]rx[167]rx[178]rf
370 [139]rf[179]rn[167]rn[178]rf
375 r(ic)[178]rf:xr[178]am
380 [158]ad[170]9,17
385 [143] calc air transmission at occulting object
390 kr[178]1.13e[171]11[172]((n[171]1)[174]2)[172](w[174][171]4)
395 ka[178]kd[172]((w[173].000055)[174]aa):cz[178][190](z0)
400 xa[178]1[173](cz[170].8[172][186](ah[173]r0)[172][189]([171].38[172]cz[172][186](r0[173]ah)))
405 k0[178]ks(ic)[172]oz[173]3
410 x0[178]1[173][186](1[171]([191](z0)[173](1[170]((hs[171]h)[173]r0)))[174]2)
415 kx[178]kr[172]xr[170]ka[172]xa[170]k0[172]x0:[139]kx[177]90[167]kx[178]90
420 tr(ic)[178]10[174]([171].4[172]kx)
425 :
430 [143] calculate sun's flux above atmosphere
435 bb[178].0000374[172](w[174][171]5)[173]([189](1.43[173](w[172]ts))[171]1)
440 fa(ic)[178]((rs[173]ds)[174]2)[172]bb[172]1e[171]8
445 [130]ic
450 [158]ad[170]9,17
455 [143] pick relevant timr range for calc
460 cz[178][190](z0[170]rn[170]tb[172]rs[173]ds)
465 hc[178](cz[171][191](d)[172][191](l))[173]([190](d)[172][190](l))
470 ha[178][193]([186](1[171]hc[172]hc)[173]hc):[139]hc[179]0[167]ha[178]ha[170]pi
475 t1[178]ha[172]pe[172].5[173]pi
480 cz[178][190](z0[170]rx[170]tb[172]rs[173]ds)
485 hc[178](cz[171][191](d)[172][191](l))[173]([190](d)[172][190](l))
490 ha[178][193]([186](1[171]hc[172]hc)[173]hc):[139]hc[179]0[167]ha[178]ha[170]pi
495 t2[178]ha[172]pe[172].5[173]pi
500 dt[178](t2[171]t1)[173]50
505 t0[178]t1[171]dt
510 [153]"loadclr len(NULL)for(NULL)sys(NULL)print(NULL)cont(NULL)- wait sys (NULL)ime- "
515 [153]"print -(NULL)-wait -(NULL)-wait -(NULL)-mag. "
520 [143] main loop starts here
525 [129]it[178][171]1[164]19
530 t[178]t1[170]it[172]dt
535 tt[178]t[171]t0
540 :
545 [143] cycle through wavelengths
550 [129]ic[178]1[164]11
555 [143] calc altitude of the solar disk for that color
560 ha[178]2[172]pi[172]t[173]pe
565 cz[178][191](d)[172][191](l)[170][190](d)[172][190](l)[172][190](ha)
570 za[178][193]([186](1[171]cz[172]cz)[173]cz):[139]cz[179]0[167]za[178]za[170]pi
575 za[178]za[171]r(ic)
580 :
585 [143] calc the fraction of disk visible
590 cc[178](za[171]z0)[172]tb[172]ds[173]rs
595 [139]cc[177]1[167]cc[178]1
600 th(ic)[178][193]([186](1[171]cc[172]cc)[173]cc)
605 [139]cc[179]0[167]th(ic)[178]th(ic)[170]pi
610 fr[178](th(ic)[171]cc[172][191](th(ic)))[173]pi
615 :
620 [143] calc visible flux from sun
625 f(ic)[178]fa(ic)[172]tr(ic)[172]fr
630 [130]ic
635 :
640 [143] could print out flux f(ic) [erg/cm2/s/a]
645 [143] as well as the sun's stellar magnitude
650 [143] m(ic)=-2.5*log(f(ic))/b0-(m0(ic)+20)
655 [143] as a function of the color ic where
660 [143] 1=3000a, 2=3500a, 3=4000a, ...., 11=8000a
665 :
670 xx[178]0:yy[178]0:zz[178]0
675 [129]ic[178]1[164]11
680 xx[178]xx[170]x1(ic)[172]f(ic)
685 yy[178]yy[170]y1(ic)[172]f(ic)
690 zz[178]zz[170]z1(ic)[172]f(ic)
695 [130]ic
700 [139]xx[170]yy[170]zz[178]0[167]780
705 x[178]xx[173](xx[170]yy[170]zz)
710 y[178]yy[173](xx[170]yy[170]zz)
715 [139]y[179].01[167]780
720 ph[178][193]((.333[171]x)[173](y[171].333))
725 [139](y[171].333)[179]0[167]ph[178]ph[170]pi
730 co$[178]"clr (NULL)right$(NULL)(NULL)val(NULL) "
735 [139]ph[179]4.229[167]co$[178]"cont peek(NULL)(NULL)val "
740 [139]ph[179]2.580[167]co$[178]"print chr$(NULL)valval(NULL) "
745 [139]ph[179]1.106[167]co$[178]"sys (NULL)val(NULL)(NULL)(NULL)(NULL) "
750 [139]ph[179].359[167]co$[178]"for (NULL)(NULL)atn(NULL)chr$val "
755 [139]ph[179]0.000[167]co$[178]" (NULL)valstr$ "
760 v[178][171]2.5[172][188](.034[172]yy[173]2.54e[171]10)[173]b0
765 [153]co$,tt
770 [153]x;y;v:[158]ad[170]9,18
775 lc[178]lc[170]1:[139]lc[178][177]10[167][141]1100
780 [130]it
785 [141]3000
790 [153]"load":[137]42
795 [143] refraction subroutine (quick version)
800 n[178]1[170](n0[171]1)[172][189]([171]h[173]s)
805 bs[178]r0[172][191](z0)[173](r0[170].5[172]s):be[178][193](bs[173][186](1[171]bs[172]bs))
810 r5[178]n[172]bs:rf[178][193](r5[173][186](1[171]r5[172]r5))[171]be:cz[178][190](z0)
815 am[178]1[173](cz[170].8[172][186](s[173]r0)[172][189]([171].38[172]cz[172][186](r0[173]s)))
820 [142]
825 :
830 [143] constants and data statements
835 rx[178][171]1:rn[178]1
840 pi[178][255]:b0[178][188](10)
845 [134]a(8),b(8),pp(8),mx(8),ks(11),m0(11